<template>
	<view class="car_type" @click="toOrder(data.AC001)">
		<view class="type_top">
			<view class="type_img">
				<tm-images :src="baseurl+data.AC003" ></tm-images>
			</view>
			<view class="top_text">
				<view class="one">
					{{data.AC002}}
				</view>
				<view class="two">
					{{data.AC004}}
				</view>
			</view>
		</view>
		<tm-divider  ></tm-divider>
		<view class="top_feature">
			<tm-tags color="bg-gradient-pink-accent" size="s" v-for="(item,index) in capture" :key="index">{{item}}</tm-tags>
		</view>
		<view class="type_bottom">
			<view class="one">
				<span>{{data.AC007}}%</span>满意   <text @click="toCarDetails(data.AC003,data.AC002,data.AC005)">车辆详情></text>
			</view>
			<view class="two">
				<span>￥{{data.AC006}}</span>/均价
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:'CarType',
		props:{
			data:{
				type:Object
			}
		},
		onLoad() {
		
		},
		data() {
			return {
				baseurl:'http://localhost:3050'
			}
		},
		methods: {
			toCarDetails(img,name,arr){
				uni.navigateTo({
					url:`/pages/cardetails/cardetails?img=${img}&name=${name}&arr=${arr}`
				})
			},
			toOrder(id){
				uni.navigateTo({
					url:`/pages/orderconfirm/orderconfirm?carid=${id}`
				})
			}
		},
		computed:{
			capture(a){
			console.log('aaaaaaaaaaaa',a.data.AC005)
			let arr = a.data.AC005.split('、')
			return arr
			}
		}
	}
</script>

<style lang="scss" scoped>
	.car_type{
		
    width: 98%;
	margin: auto;
	margin-top: 30rpx;
    padding: 20rpx;
    height: 100%;
    background-color: #FFFFFF;
    border-radius: 20rpx;
    box-sizing: border-box;
    box-shadow: 0rpx 0rpx 20rpx #cccccc;
		.type_top{
			display: flex;
			align-items: center;
			padding: 20rpx;
			.type_img{
				width: 30%;
			}
			.top_text{
				margin-left: 30rpx;
				.one{
					font-size: 32rpx;
					font-weight: 600;
					
				}
				.two{
					font-size: 28rpx;
					color: #8c8c8c;
				}
			}
		}
	.top_feature{
		margin: 10rpx 0;
	}
	.type_bottom{
		display: flex;
		justify-content: space-between;
		.one{
			font-size: 24rpx;
			color: #8c8c8c;
			span{
				color:  #d99f66;
				font-size: 22rpx;
			}
			text{
				margin-left: 6rpx;
			}
		}
		.two{
			font-size: 24rpx;
			color: #8c8c8c;
			span{
				color: #e8893b;
				font-size: 28rpx;
				font-weight: 700;
			}
		}

		
	}
}
</style>
